-
Notifications
You must be signed in to change notification settings - Fork 2
Add Terraform deployment example #31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Co-authored-by: andreasohlund <125028+andreasohlund@users.noreply.github.com>
Co-authored-by: andreasohlund <125028+andreasohlund@users.noreply.github.com>
Co-authored-by: andreasohlund <125028+andreasohlund@users.noreply.github.com>
|
Tested locally and runs fine on my mac |
| name = docker_network.service_platform.name | ||
| } | ||
|
|
||
| ports { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it intended to bind to 0.0.0.0 for all the port exposures? I guess we should bind to the local NIC. Espcially if we use default username and/or password.
| @@ -0,0 +1,34 @@ | |||
| output "servicepulse_url" { | |||
| description = "URL for ServicePulse web interface" | |||
| value = "http://localhost:${var.servicepulse_port}" | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
localhost can be resolved to IPv4 or IPv6. Does it matter in this case? Shouldn't we bind explicitly to either of these?
| variable "docker_host" { | ||
| description = "Docker daemon host (e.g., unix:///var/run/docker.sock for local, or tcp://host:2376 for remote)" | ||
| type = string | ||
| default = "unix:///var/run/docker.sock" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this compatible with docker running in WSL? I'm not sure if docker in WSL exposes the TCP socket out of the box. Might be worth adding a note for that.
| default = "latest" | ||
| } | ||
|
|
||
| variable "transport_type" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess we could add validation to this variable. hashicorp/terraform#25283
| default = "RabbitMQ.QuorumConventionalRouting" | ||
| } | ||
|
|
||
| variable "connection_string" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be marked as sensitive.
| } | ||
|
|
||
| # RabbitMQ container | ||
| resource "docker_image" "rabbitmq" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this resource should be optional. I can imagine someone willing to run SC + SP with their own transport.
Adds Terraform configuration equivalent to existing docker-compose, helm, azure-container-apps, and unraid examples for deploying ServiceControl platform components.
Implementation
terraform/main.tf: Provisions 6 containers (servicecontrol, servicecontrol-audit, servicecontrol-monitoring, servicepulse, servicecontrol-ravendb, rabbitmq) using Docker provider with proper dependencies, health checks, and networkingterraform/variables.tf: Configurable image tags, ports, transport settings, and licenseterraform/outputs.tf: Service URLs for quick accessterraform/README.md: Usage instructions covering init/plan/apply lifecycle, port configuration, and troubleshootingterraform/.gitignore: Standard Terraform exclusionsterraform/terraform.tfvars.example: Configuration templateKey Details
/usr/lib/ravendb/scripts/healthcheck.shfrom the official imageExample deployment:
terraform init terraform apply # Access ServicePulse at http://localhost:9090Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
checkpoint-api.hashicorp.com/usr/local/bin/terraform terraform version(dns block)/usr/local/bin/terraform terraform init(dns block)/usr/local/bin/terraform terraform validate(dns block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.